package com.cj.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

@SuppressWarnings("serial")
public class Bonus extends Model<Bonus> {
	public static final Bonus me = new Bonus();
	
    public List<Bonus> getAllBonus() {
		String sql = "select * from bonus b left join employee e on b.empId = e.empId";
		return find(sql);
	}
    
    public List<Bonus> getBonusByEmployee(Integer empId) {
		String sql = "select * from bonus b left join employee e on b.empId = e.empId where e.empId = ?";
		return find(sql, empId);
	}
    
    public List<Bonus> getBonusByTime(Integer empId, String time) {
    	String sql = "select * from bonus where empId = ? and bonusTime = ?";
    	return find(sql, empId, time);
    }
}
